package com.yan.design.two.establish.s4.builder2;



/**
 * 四.建造者模式
 *      抽象方法 - 建造者
 * @author shengren.yan
 * @create 2022-07-17
 */
public class Worker extends Builder{

    Product product = null;

    public Worker(){
        product = new Product();
    }


    @Override
    Builder buildA(String key) {
        product.setBuildA(key);
        System.out.println(key);
        return this;
    }

    @Override
    Builder buildB(String key) {
        product.setBuildB(key);
        System.out.println(key);
        return this;
    }

    @Override
    Builder buildC(String key) {
        product.setBuildC(key);
        System.out.println(key);
        return this;
    }

    @Override
    Product getProduct() {
        return product;
    }
}
